<template>
	<view class="wrapForm">
		<view class="bgLine pL25 pR25">
			<view class="font26 bold">请输入六位数的开工码</view>
			<view class="font14 u-9 mT5 pB15">
				开工码已发至雇主手机，请询问雇主
			</view>
		</view>
		<view class="wrapFormBody pL15 pR15 pT20 rzBox">
			<view class="font18">请输入开工码</view>
			<view class="mT30">
				<u-message-input :focus="true" :breathe="false" :width="90"  maxlength="6" v-model="valueModel"></u-message-input>
			</view>
			<view class="flex alg-center mT10">
				<image class="imgW32" :src="resources.posIcon" mode=""></image>
				<text class="font14">{{processAddress}}</text>
			</view>
			<view @click="sureKgCode" class="pointer rightNowPay u-f font15 t-center mT40">
				确定
			</view>
		</view>
		
	</view>
</template>

<script>
	import {workCode} from "@/api/userInterface/user.js"
	import {
		getLocalAddress
	} from "@/libs/map.js"
	export default {
		data() {
			return {
				valueModel:'',
				orderId:'',
				regisid:'',
				processAddress: ''
			}
		},
		onLoad(e) {
			this.orderId=e.orderId;
			this.regisid=e.regisId;
			getLocalAddress().then(res=>{
				this.processAddress=res.result.formatted_addresses.recommend
			})
			console.log(e)
		},
		methods: {
			sureKgCode(){
				if(this.valueModel.length<6){
					this.xf.onlineUtils.toast('开工码格式不正确')
				}else{
					workCode({
						orderId:this.orderId,
						workCode:this.valueModel,
						regisid:this.regisid,
						processAddress: this.processAddress
					}).then(res=>{
						uni.showToast({
							icon:"none",
							title:"校验成功",
							duration:2000
						})
						setTimeout(()=>{
							uni.navigateBack()
						},2000)
					})
				}
			}
		}
	}
</script>
<style lang="scss">
	page {
		
		min-height: 100%;
		background-color: #fff;
	}
</style>
<style lang="scss" scoped>
	.wrapForm{
		.rzCardBox{
			
			height: 128rpx;
			background: #F8F8F8;
			border-radius: 16rpx 16rpx 16rpx 16rpx;
			margin-top: 60rpx;
			&:last-child{
				margin-top: 30rpx;
			}
			.imgRzCard{
				width: 40rpx;
				height: 32rpx;
			}
		}
		height: 100%;
		.wrapFormBody{
			margin-top: -30rpx;
			border-radius: 40rpx 40rpx 0 0;
			background: #fff;
		}
		.uni-forms-item{
			align-items: center !important; 
		}
		.uni-input-placeholder{
			// text-align: right !important;
			color: #BDBDBD !important;
		}
	}
	.bgLine{
		background-color: #E1EEFF;
		width: 100%;
		// height: 60rpx;
		padding:30rpx 40rpx;
		.rzImg{
			width:168rpx;
			height: 192rpx;
		}
	}
	.bottomW{
		position: fixed;
		bottom:40rpx;
		width: 100%;
		left: 0;
	}
	.rightNowPay{
		width: 670rpx;
		height: 100rpx;
		line-height: 100rpx;
		background: #3291F8;
		border-radius: 30rpx;
		
	}
</style>
